package org.agile2soft.nexoma.core.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
@SuppressWarnings({"serial"})
public class UserRequestId implements java.io.Serializable {

    private String documentNumber;
    private Integer id;

    public UserRequestId() {
    }

    public UserRequestId(String documentNumber, Integer id) {
        this.documentNumber = documentNumber;
        this.id = id;
    }

    @Column(name = "CIU_DOCUMENT_NUMBER", nullable = false, length = 25)
    public String getDocumentNumber() {
        return this.documentNumber;
    }

    public void setDocumentNumber(String documentNumber) {
        this.documentNumber = documentNumber;
    }

    @Column(name = "SOL_ID", nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public boolean equals(Object other) {
        if ((this == other))
            return true;
        if ((other == null))
            return false;
        if (!(other instanceof UserRequestId))
            return false;
        UserRequestId castOther = (UserRequestId) other;

        return ((this.getDocumentNumber() == castOther
                .getDocumentNumber()) || (this.getDocumentNumber() != null
                && castOther.getDocumentNumber() != null && this
                .getDocumentNumber().equals(
                        castOther.getDocumentNumber())))
                && (this.getId() == castOther.getId());
    }

    public int hashCode() {
        int result = 17;

        result = 37
                * result
                + (getDocumentNumber() == null ? 0 : this
                        .getDocumentNumber().hashCode());
        result = 37 * result + this.getId();
        return result;
    }

}
